<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改学生信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-student-edit" th:object="${xzkStudent}">
        <input name="stuid" th:field="*{stuid}" type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">学员姓名：</label>
            <div class="col-sm-8">
                <input name="stuname" th:field="*{stuname}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">电话：</label>
            <div class="col-sm-8">
                <input name="stuphone" th:field="*{stuphone}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">课程类型：</label>
            <div class="col-sm-8">
                <select name="coursetype" class="form-control m-b" th:with="type=${@dict.getType('sys_course_type')}" required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{coursetype}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">班级：</label>
            <div class="col-sm-8">
                <input name="gradeid" th:field="*{gradeid}" class="form-control" type="text">
                <span id="span"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">性别：</label>
            <div class="col-sm-8">
                <select name="stusex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}" required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{stusex}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">毕业学校：</label>
            <div class="col-sm-8">
                <input name="school" th:field="*{school}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">专业：</label>
            <div class="col-sm-8">
                <input name="major" th:field="*{major}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">毕业时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="graduatetime" th:value="${#dates.format(xzkStudent.graduatetime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">目标就业城市：</label>
            <div class="col-sm-8">
                <input name="targetcity" th:field="*{targetcity}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">销售：</label>
            <div class="col-sm-8">
                <input name="seller" th:field="*{seller}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">籍贯：</label>
            <div class="col-sm-8">
                <input name="nativeplace" th:field="*{nativeplace}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">班主任：</label>
            <div class="col-sm-8">
                <input name="teachername" th:field="*{teachername}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">年龄：</label>
            <div class="col-sm-8">
                <input name="age" th:field="*{age}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">最高学历：</label>
            <div class="col-sm-8">
                <input name="topschool" th:field="*{topschool}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所在城市：</label>
            <div class="col-sm-8">
                <input name="city" th:field="*{city}" class="form-control" type="text">
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">学习时间：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="studytime" th:field="*{studytime}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">目前状况：</label>
            <div class="col-sm-8">
                <input name="currentstatus" th:field="*{currentstatus}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">学习目的：</label>
            <div class="col-sm-8">
                <input name="learngoal" th:field="*{learngoal}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">目标岗位：</label>
            <div class="col-sm-8">
                <input name="targetposition" th:field="*{targetposition}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">目前薪资：</label>
            <div class="col-sm-8">
                <input name="currentsalary" th:field="*{currentsalary}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">收件信息：</label>
            <div class="col-sm-8">
                <input name="consignee" th:field="*{consignee}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">学习状态：</label>
            <div class="col-sm-8">
                <select name="studystatus" class="form-control m-b" th:with="type=${@dict.getType('sys_student_status')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{studystatus}"></option>
                </select>
                <div id="div1" style="display: none;">
                    休学开始时间：<div class="input-group date">
                    <input name="startSuspend" th:value="${#dates.format(xzkStudent.startSuspend, 'yyyy-MM-dd')} == null ? ${#dates.format(xzkStudent.graduatetime, 'yyyy-MM-dd')} : ${#dates.format(xzkStudent.startSuspend, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
                    休学结束时间：
                    <div class="input-group date">
                        <input name="stopSuspend" th:value="${#dates.format(xzkStudent.stopSuspend, 'yyyy-MM-dd')} == null ? ${#dates.format(xzkStudent.graduatetime, 'yyyy-MM-dd')} : ${#dates.format(xzkStudent.stopSuspend, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">支付类型：</label>
            <div class="col-sm-8">
                <select name="paymode" class="form-control m-b" th:with="type=${@dict.getType('sys_pay_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{paymode}"></option>
                </select>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">已支付：</label>
            <div class="col-sm-8">
                <input name="paymoney" th:field="*{paymoney}" class="form-control" type="text">
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">余额：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="remainingsum" th:field="*{remainingsum}" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">订单号：</label>
            <div class="col-sm-8">
                <input name="ordernum" th:field="*{ordernum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">补交金额：</label>
            <div class="col-sm-8">
                <input name="Payamount" th:field="*{Payamount}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">最新学习进度：</label>
            <div class="col-sm-8">
                <input name="latestprogress" th:field="*{latestprogress}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">完成进度：</label>
            <div class="col-sm-8">
                <input name="Completeproportion" th:field="*{Completeproportion}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "student/student";
    $("#form-student-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-student-edit').serialize());
        }
    }

    $("input[name='graduatetime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
    $("input[name='gradeid']").blur(function (){
        var message = null;
        var classes=$("input[name='gradeid']").val().toString();
        alert(classes)
        $.post(prefix+"/class","classname="+classes,function(data){
            console.log(data)
            message = data.msg;
            if(message == classes){
                $("#span").html("<img src='../../../img/zhengque.jpg' width='30px' height='30px' style='margin-left:480px; margin-top: -50px'>");
            }else{
                $("#span").html("<img src='../../../img/cuowu.jpg' width='30px' height='30px' style='margin-left:480px; margin-top: -50px'>");
            }
        });
    })


    $("select[name='studystatus']").change(function (){
        var a=$("select[name='studystatus'] option:selected").val();
        alert(a)
        if(a=="suspensionofschooling"){
             $("#div1").attr("style","display:bolck");
        }else{
            $("#div1").attr("style","display:none");
        }

    })
</script>
</body>
</html>